package com.gxa.zhonglong.service.impl;

import com.gxa.zhonglong.mapper.GoodsSeriesMapper;
import com.gxa.zhonglong.pojo.GoodsSeries;
import com.gxa.zhonglong.service.GoodsSeriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wanjun
 * @version 1.0
 * @date 2021/11/1 15:43
 */
@Transactional(rollbackFor = Throwable.class)
@Service
public class GoodsSeriesServiceImpl implements GoodsSeriesService {
    @Autowired
    GoodsSeriesMapper goodsSeriesMapper=null;
    @Override
    public void insert(GoodsSeries goodsSeries) {
        goodsSeriesMapper.insert(goodsSeries);
    }

    @Override
    public void delete(List<Long> listId) {
        for (Long aLong : listId) {
            goodsSeriesMapper.delete(aLong);
        }
    }

    @Override
    public void update(GoodsSeries goodsSeries) {
         goodsSeriesMapper.update(goodsSeries);
    }

    @Override
    public List<GoodsSeries> selectAll() {
        return goodsSeriesMapper.selectAll();
    }
}
